﻿package com.gengine.utils
{
    import flash.utils.*;

    public class HashMap extends Object
    {
        private var _dic:Dictionary;
        private var _keys:Array;

        public function HashMap()
        {
            this._dic = new Dictionary(true);
            this._keys = new Array();
            return;
        }// end function

        public function push(param1, param2) : void
        {
            if (this._keys.indexOf(param1) == -1)
            {
                this._keys.push(param1);
            }
            this._dic[param1] = param2;
            return;
        }// end function

        public function getValue(param1) : Object
        {
            return this._dic[param1];
        }// end function

        public function remove(param1) : void
        {
            var _loc_2:int = 0;
            while (_loc_2 < this._keys.length)
            {
                
                if (this._keys[_loc_2] == param1)
                {
                    this._keys.splice(_loc_2, 1);
                    delete this._dic[param1];
                }
                _loc_2++;
            }
            return;
        }// end function

        public function removeAll() : void
        {
            var _loc_1:Object = null;
            this._keys.length = 0;
            for each (_loc_1 in this._dic)
            {
                
                delete this._dic[_loc_1];
            }
            return;
        }// end function

        public function get keys() : Array
        {
            return this._keys;
        }// end function

        public function get values() : Array
        {
            var _loc_2:Object = null;
            var _loc_1:* = new Array();
            for each (_loc_2 in this._keys)
            {
                
                _loc_1.push(this._dic[_loc_2]);
            }
            return _loc_1;
        }// end function

        public function get length() : int
        {
            return this._keys.length;
        }// end function

    }
}
